package com.twu.biblioteca.library.shelf;

import com.twu.biblioteca.library.item.LibraryItem;
import java.util.TreeSet;


abstract public class Shelf {

    public TreeSet<LibraryItem> collection;

    public LibraryItem findItem(int id) {
        for( LibraryItem item : collection){
            if(item.getId() == id){
                return item;
            }
        }
        return null;
    }

    public int listItems() {
        int i = 0;
        collection.first().getHeader();
        for(LibraryItem item : collection){
            i++;
            item.printItem();
        }
        return i;
    }

}
